package Information_sysyem_jdbc.Service.impl;

import Information_sysyem_jdbc.Dao.InformationDao;
import Information_sysyem_jdbc.Dao.impl.InformationDaoimpl;
import Information_sysyem_jdbc.Service.InformationService;
import Information_sysyem_jdbc.entity.Information;

import java.util.List;

/**
 * @author LiangHaiBo
 * @version 1.0
 * @date 2021.8.21 上午 9:34
 */
public class InformationServiceimpl implements InformationService {
    @Override
    public List<Information> selectFindAllGet() {
        InformationDao fd = new InformationDaoimpl();
        List<Information> list = fd.selectFindAll();
        return list;
    }

    @Override
    public Information selectfindByidGet(int id) {
        InformationDao fd = new InformationDaoimpl();
        Information information = fd.selectfindByid(id);
        return information;
    }

    @Override
    public int selectAllCountGet() {
        InformationDao fd = new InformationDaoimpl();
        int i = fd.selectAllCount();
        return i;
    }

    @Override
    public int addGet(Information information) {
        InformationDao fd = new InformationDaoimpl();
        return fd.add(information);
    }

    @Override
    public int deleteGet(int id) {
        InformationDao fd = new InformationDaoimpl();
        return fd.delete(id);
    }

    @Override
    public int updateInformationGet(int id) {
        InformationDao fd = new InformationDaoimpl();
        return fd.update(id);
    }

    @Override
    public List<Information> limitGet(int page, int pagesize) {
        InformationDao  fd = new InformationDaoimpl();
        List<Information> list = fd.limit(page, pagesize);
        return list;
    }


}
